<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<% 
	String context = request.getContextPath(); 
%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="content-type" content="text/html;charset=utf-8">
		<title>OA</title>
		<link rel="stylesheet" href="<%=context %>/ligerUI/lib/ligerUI/skins/ligerui-icons.css" />
		<link rel="stylesheet" href="<%=context %>/ligerUI/lib/ligerUI/skins/Aqua/css/ligerui-all.css" />
		<script src="<%=context %>/ligerUI/lib/jquery/jquery-1.9.0.min.js"></script>
		<script src="<%=context %>/ligerUI/lib/ligerUI/js/ligerui.all.js"></script>
		<style type="text/css">
			body,html{height:100%;}
			body{ padding:0px; margin:0;overflow:hidden;background:#EAEEF5;}
			.l-topmenu{ margin:0; padding:0; height:31px; line-height:31px; background:url('<%=context %>/ligerUI/lib/images/top.jpg') repeat-x bottom;  position:relative; border-top:1px solid #1D438B;  }
		    .l-topmenu-logo{ color:#E7E7E7; padding-left:35px; line-height:26px;background:url('<%=context %>/ligerUI/lib/images/topicon.gif') no-repeat 10px 5px;}
		    .l-topmenu-welcome{  position:absolute; height:24px; line-height:24px;  right:30px; top:2px;color:#070A0C;}
		    .l-topmenu-welcome a{ color:#E7E7E7; text-decoration:underline}
		</style>
	</head>

	<body>
		<!--顶部 S-->
		<div id="topmenu" class="l-topmenu">
			<div class="l-topmenu-logo">xxx管理系统</div>
			
			<div class="l-topmenu-welcome">
				
			</div> 
		</div>
		<!--顶部 E-->
		
		<!--Body S-->
		<div id="layout1" style="width:99.2%; margin:0 auto; margin-top:4px; ">
			<!--左侧菜单-->
			<div position="left"  title="主要菜单" id="menu">
				<div title="功能列表" class="l-scroll">
                     <ul id="tree1" style="margin-top:3px;">
                </div>
			</div>
			
			<!--右侧内容-->
			<div position="center" id="framecenter">
				<div tabid="home" title="我的主页" style="height:300px" >
					<iframe frameborder="0" name="home" id="home" src=""></iframe>
				</div> 
			</div> 
		</div>
		<!--Body S-->
		
		<!--底部 S-->
		<div  style="height:32px; line-height:32px; text-align:center;">
				Copyright © 2011-2014 www.ligerui.com
		</div>
		<!--底部 E-->
	</body>
	<script>
	var tab = null;
	var accordion = null;
	var tree = null;
	var tabItems = [];
	function f_addTab(tabid, text, url){
	    tab.addTabItem({
	        tabid: tabid,
	        text: text,
	        url: url
	    });
	}
		$(function(){
			//布局
			$("#layout1").ligerLayout({
				leftWidth: 190,
				height: '100%',
				heightDiff: -34,
			});

			var height = $(".l-layout-center").height();

			//Tab
			tab = $("#framecenter").ligerTab({
				height: height,
				showSwitchInTab : true,
				showSwitch: true,
				onAfterAddTabItem: function (tabdata){
					tabItems.push(tabdata);
				},
				onAfterRemoveTabItem: function (tabid){ 
					for (var i = 0; i < tabItems.length; i++){
						var o = tabItems[i];
						if (o.tabid == tabid){
							tabItems.splice(i, 1);
							break;
						}
					}
				},
				onReload: function (tabdata)
				{
					var tabid = tabdata.tabid;
				}
			});

			//菜单面板
			$("#menu").ligerAccordion({
				height: height - 24, speed: null
			});
			tab = liger.get("framecenter");
			accordion = liger.get("accordion1");
			tree = liger.get("tree1");
			$("#pageloading").hide();
			var data = [
				{ text: '基础',isexpand:false, children: [ 
					{url:"demos/base/resizable.htm",text:"改变大小" },
					{url:"demos/base/drag.htm",text:"拖动"},
					{url:"demos/base/drag2.htm",text:"拖动2"},
					{url:"demos/base/dragresizable.htm",text:"拖动并改变大小"},
					{url:"demos/base/tip.htm",text:"气泡"},
					{url:"demos/base/tip2.htm",text:"气泡2"}
				]
			    }
			];
			$("#tree1").ligerTree({
				data : data,
				checkbox: false,
				slide: false,
				nodeWidth: 120,
				attribute: ['nodename', 'url'],
				render : function(a){
					if (!a.isnew) return a.text;
					return '<a href="' +path+"/"+a.url + '" target="_blank">' + a.text + '</a>';
				},
				onSelect: function (node)
				{
					if (!node.data.url){
						return;
					}
					if (node.data.isnew){ 
						return;
					}
					var tabid = $(node.target).attr("tabid");
					if (!tabid){
						tabid = new Date().getTime();
						$(node.target).attr("tabid", tabid)
					}
					f_addTab(tabid, node.data.text, node.data.url);
				}
			});

		});
	</script>
</html>